home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / il / ilVkRotZoomView.z / ilVkRotZoomView
Encoding:
Text File  |  2002-10-03  |  14.0 KB  |  331 lines

  1.  
  2.  
  3.  
  4. iiiillllVVVVkkkkRRRRoooottttZZZZoooooooommmmVVVViiiieeeewwww((((3333))))                    IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      iiiillllVVVVkkkkRRRRoooottttZZZZoooooooommmmVVVViiiieeeewwww - rotates and zooms a single ilImage
  10.  
  11. IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM
  12.      ilVkView
  13.  
  14. HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
  15.      #include <il/ilVkRotZoomView.h>
  16.  
  17. CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      This component rotates and zooms a single ilImage within an
  19.      SSSSggggVVVViiiissssuuuuaaaallllDDDDrrrraaaawwwwiiiinnnnggggAAAArrrreeeeaaaa widget. It supports zoom-to-fit and also allows
  20.      arbitrary zoom and rotation. It uses an iiiillllRRRRoooottttZZZZoooooooommmmIIIImmmmgggg object to perform
  21.      the rotation and zoom. Since it is derived from iiiillllVVVVkkkkVVVViiiieeeewwww, it supports all
  22.      of the same visuals that iiiillllVVVVkkkkVVVViiiieeeewwww supports.  It is useful as an image
  23.      overview for large images and can also be used to show an image zoomed up
  24.      for detailed viewing.
  25.  
  26. CCCCLLLLAAAASSSSSSSS MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN SSSSUUUUMMMMMMMMAAAARRRRYYYY
  27.      CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrr
  28.  
  29.            ilVkRotZoomView(const char* name, Widget parent)
  30.            ilVkRotZoomView(const char* name, Widget parent, int attributes,
  31.                            int minComponentSize=8, int maxComponentSize=0)
  32.  
  33.      GGGGeeeetttt////sssseeeetttt iiiinnnnppppuuuutttt mmmmeeeetttthhhhooooddddssss
  34.  
  35.           const char* className()
  36.           void setAngle(float ang)
  37.           float getAngle()
  38.           void setZoom(float x, float y)
  39.           void setZoom(String s)
  40.           void getZoom(float& x, float& y)
  41.           void setCenter(float x, float y)
  42.           void setCenter(String s)
  43.           void getCenter(float& x, float& y)
  44.           void setResampType(ilResampType rs)
  45.           ilResampType getResampType()
  46.           void sizeToFit(int enable = True)
  47.           void keepAspect(int enable = True)
  48.           virtual void expose(Widget, XtPointer)  _p_r_o_t_e_c_t_e_d
  49.           virtual void input(Widget, XtPointer)   _p_r_o_t_e_c_t_e_d
  50.           virtual void resize(Widget, XtPointer)  _p_r_o_t_e_c_t_e_d
  51.           virtual void ilUpdateWidget() _p_r_o_t_e_c_t_e_d
  52.  
  53.  
  54. FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNSSSS
  55.      iiiillllVVVVkkkkRRRRoooottttZZZZoooooooommmmVVVViiiieeeewwww(((())))
  56.  
  57.            ilVkRotZoomView(const char* name, Widget parent)
  58.            ilVkRotZoomView(const char* name, Widget parent, int attributes,
  59.                            int minComponentSize=8, int maxComponentSize=0)
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. iiiillllVVVVkkkkRRRRoooottttZZZZoooooooommmmVVVViiiieeeewwww((((3333))))                    IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll
  71.  
  72.  
  73.  
  74.           Both versions of the constructor take the _n_a_m_e of the component and
  75.           also a pointer to the parent widget. The new view is created as a
  76.           child of the specified _p_a_r_e_n_t widget.
  77.  
  78.           In the second version three additional parameters allow the
  79.           attributes of the chosen visual to be specified. These parameters
  80.           follow the parameters for constructing an iiiillllVVVVkkkkVVVViiiieeeewwww (see iiiillllVVVVkkkkVVVViiiieeeewwww(3)
  81.           for more information).
  82.  
  83.      ccccllllaaaassssssssNNNNaaaammmmeeee(((())))
  84.  
  85.           const char *   className()
  86.  
  87.  
  88.           Returns the name of the compoent.
  89.  
  90.      eeeexxxxppppoooosssseeee(((())))
  91.  
  92.           virtual void  expose(Widget, XtPointer) _p_r_o_t_e_c_t_e_d
  93.  
  94.  
  95.           This virtual method is called by the expose callback when the
  96.           component is exposed. The contents of the drawing area are redrawn
  97.           by calling the redraw method on ilDisplay.
  98.  
  99.      ggggeeeettttAAAAnnnngggglllleeee(((())))
  100.  
  101.           float  getAngle()
  102.  
  103.  
  104.           Returns the current angle of rotation. See also sssseeeettttAAAAnnnngggglllleeee().
  105.  
  106.      ggggeeeettttCCCCeeeennnntttteeeerrrr(((())))
  107.  
  108.           void  getCenter(float& x, float& y)
  109.  
  110.  
  111.           Returns the current x,y center of the zoomed image. See also
  112.           sssseeeettttCCCCeeeennnntttteeeerrrr().
  113.  
  114.      ggggeeeettttRRRReeeessssaaaammmmppppTTTTyyyyppppeeee(((())))
  115.  
  116.           ilResampType  getResampType()
  117.  
  118.  
  119.           Returns the current resample type. See also sssseeeettttRRRReeeessssaaaammmmppppTTTTyyyyppppeeee().
  120.  
  121.      ggggeeeettttZZZZoooooooommmm(((())))
  122.  
  123.           void  getZoom(float& x, float& y)
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. iiiillllVVVVkkkkRRRRoooottttZZZZoooooooommmmVVVViiiieeeewwww((((3333))))                    IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll
  137.  
  138.  
  139.  
  140.           Returns the current x zoom factor and y zoom factor. See also
  141.           sssseeeettttZZZZoooooooommmm().
  142.  
  143.      iiiillllUUUUppppddddaaaatttteeeeWWWWiiiiddddggggeeeetttt(((())))
  144.  
  145.           virtual void  ilUpdateWidget()     _p_r_o_t_e_c_t_e_d
  146.  
  147.  
  148.           This virtual function is called when attributes of the displayed
  149.           image are changed or when the drawing area is changed. For example,
  150.           if _s_i_z_e_T_o_F_i_t or _k_e_e_p_A_s_p_e_c_t_R_a_t_i_o are changed, iiiillllUUUUppppddddaaaatttteeeeWWWWiiiiddddggggeeeetttt is
  151.           called to re-display the image. If the drawing area is resized, the
  152.           image may have to be zoomed to match the new size.
  153.  
  154.      iiiinnnnppppuuuutttt(((())))
  155.  
  156.           virtual void  input(Widget, XtPointer)  _p_r_o_t_e_c_t_e_d
  157.  
  158.  
  159.           This virtual function is called by the input callback when X input
  160.           events are received. Since this component statically displays an
  161.           ilImage, no actions are performed in response to input events. How-
  162.           ever, a derived class may choose to manipulate the image within the
  163.           ilDisplay object in response to input events. See also iiiillllVVVVkkkkVVVViiiieeeewwwweeeerrrr.
  164.  
  165.      kkkkeeeeeeeeppppAAAAssssppppeeeecccctttt(((())))
  166.  
  167.           void  keepAspect(int enable = True)
  168.  
  169.  
  170.           This method enables or disables the ability to maintain the aspect
  171.           ratio when the image is zoomed.  If _T_r_u_e is passed, then aspect
  172.           ratio will be maintained and may limit zooming. If _F_a_l_s_e is passed,
  173.           then aspect ratio will not be maintained during zooming and the
  174.           image may stretch and become distorted. Aspect ratio is the ratio of
  175.           width to height. See iiiillllRRRRoooottttZZZZoooooooommmmIIIImmmmgggg for more information.
  176.  
  177.      rrrreeeessssiiiizzzzeeee(((())))
  178.  
  179.           virtual void  resize(Widget, XtPointer) _p_r_o_t_e_c_t_e_d
  180.  
  181.  
  182.           This virtual function is called by the resize callback when the
  183.           component is resized. Note that if _s_i_z_e_T_o_F_i_t is enabled, the
  184.           displayed image will be resized to fit within the drawing area.
  185.  
  186.      sssseeeettttAAAAnnnngggglllleeee(((())))
  187.  
  188.           void   setAngle(float ang)
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. iiiillllVVVVkkkkRRRRoooottttZZZZoooooooommmmVVVViiiieeeewwww((((3333))))                    IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll
  203.  
  204.  
  205.  
  206.           Sets the angle of rotation to _a_n_g. The image is rotated counter
  207.           clock-wise from the x-axis. See iiiillllRRRRoooottttZZZZoooooooommmmIIIImmmmgggg for more information.
  208.  
  209.      sssseeeettttCCCCeeeennnntttteeeerrrr(((())))
  210.  
  211.           void  setCenter(float x, float y)
  212.           void  setCenter(String s)
  213.  
  214.  
  215.           Centers the output image on the input coordinates specified by _x and
  216.           _y. In the second version of this method, the string is scanned for
  217.           pair of floats the form "x,y".  See iiiillllRRRRoooottttZZZZoooooooommmmIIIImmmmgggg for more
  218.           information.
  219.  
  220.      sssseeeettttRRRReeeessssaaaammmmppppTTTTyyyyppppeeee(((())))
  221.  
  222.           void  setResampType(ilResampType rs)
  223.  
  224.  
  225.           Selects the type of resampling to use. For example, _i_l_N_e_a_r_N_b
  226.           specifies nearest neighbor resampling, _i_l_B_i_L_i_n_e_a_r specifies bi-
  227.           linear resampling and _i_l_B_i_C_u_b_i_c specifies bi-cubic resampling. If
  228.           _i_l_A_u_t_o_R_e_s_a_m_p is specified then the type of resampling depends on the
  229.           operation performed.  See iiiillllRRRRoooottttZZZZoooooooommmmIIIImmmmgggg or iiiillllWWWWaaaarrrrppppIIIImmmmgggg for more
  230.           information.
  231.  
  232.      sssseeeettttZZZZoooooooommmm(((())))
  233.  
  234.           void  setZoom(float x, float y)
  235.           void  setZoom(String s)
  236.  
  237.  
  238.           Sets the zoom factor in the _x and _y direction. If x and y are equal,
  239.           then the aspect ratio will be unchanged. By default, the zoom factor
  240.           is 1.0 for both x and y. In the second version of this method, the
  241.           string is scanned for either a single number or a pair of floats the
  242.           form "x,y".  If only one number is present, both x and y are set to
  243.           that number.
  244.  
  245.      ssssiiiizzzzeeeeTTTTooooFFFFiiiitttt(((())))
  246.  
  247.           void  sizeToFit(int enable = True)
  248.  
  249.  
  250.           This method enables or disables the ability to zoom the image to fit
  251.           the drawing area. If _T_r_u_e, then the image will be zoomed to fit
  252.           within the drawing area. If _F_a_l_s_e, then the image will not change
  253.           size when the drawing aea changes size. Note that the image may not
  254.           fill the drawing area if _k_e_e_p_A_s_p_e_c_t is True. See also kkkkeeeeeeeeppppAAAAssssppppeeeecccctttt().
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. iiiillllVVVVkkkkRRRRoooottttZZZZoooooooommmmVVVViiiieeeewwww((((3333))))                    IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll
  269.  
  270.  
  271.  
  272. IIIINNNNHHHHEEEERRRRIIIITTTTEEEEDDDD MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
  273.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm iiiillllVVVVkkkkVVVViiiieeeewwww
  274.      className(), expose(), getDisplay(), getDrawArea(), getSize(), input(),
  275.      map(), paint(), resize()
  276.  
  277.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm iiiillllVVVVkkkkCCCCoooommmmppppoooonnnneeeennnntttt
  278.      className(), getImage(), getParent(), ilUpdateWidget(), setImage(),
  279.      setParent()
  280.  
  281.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm VVVVkkkkCCCCoooommmmppppoooonnnneeeennnntttt
  282.      afterRealizeHook(), baseWidget(), className(), getResources(), hide(),
  283.      installDestroyHandler(), manage(), name(), okToQuit(), operator Widget(),
  284.      removeDestroyHandler(), setDefaultResources(), show(), unmanage(),
  285.      widgetDestroyed()
  286.  
  287.  
  288. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  289.      VkComponent, ilVkView, ilRotZoomImg
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.